package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.entity.rank.UnionRank;
import com.yanqu.road.entity.union.cross.CrossUnionInfo;
import com.yanqu.road.logic.pb.CrossRankPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cross.group.CrossGroupProto;
import com.yanqu.road.pb.rank.RankProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.rank.CrossRankMgr;
import com.yanqu.road.server.manager.union.CrossUnionMgr;
import com.yanqu.road.server.manager.union.CrossUnionRankMgr;
import com.yanqu.road.server.manger.ServerGroupMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_SERVER_GROUP_UNION_RANK_CHANGE, desc = "跨服分组商会排行数据变化")
public class CrossServerGroupUnionRankChangeCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
//        CrossGroupProto.CrossGroupUnionRankChangeReqMsg reqMsg = CrossGroupProto.CrossGroupUnionRankChangeReqMsg.parseFrom(packet.getBytes());
//        int groupId = ServerGroupMgr.getGroupIdByServerId(serverId);
//        for(RankProto.UnionRankTempMsg temMsg : reqMsg.getDataListList()) {
//            CrossUnionInfo unionInfo = CrossUnionMgr.getUnionInfo(temMsg.getUnionUid());
//            if (null == unionInfo){
//                continue;
//            }
//
//            UnionRank unionRank = CrossUnionMgr.pareUnionInfoToUnionRank(unionInfo);
//            CrossUnionRankMgr.changeUnionGroupRank(groupId, unionRank);
//        }
    }

    @Override
    public void sendData() {

    }
}
